package sy.model;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**
 * SysDivision entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "sys_division", catalog = "ssh")
public class SysDivision implements java.io.Serializable {

	// Fields

	private String id;
	private SysDivision sysDivision;
	private String name;
	private String code;

	// Constructors

	/** default constructor */
	public SysDivision() {
	}

	/** full constructor */
	public SysDivision(SysDivision sysDivision, String name, String code) {
		this.sysDivision = sysDivision;
		this.name = name;
		this.code = code;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "uuid.string")
	@Id
	@Column(name = "id", unique = true, nullable = false, length = 64)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "pid")
	public SysDivision getSysDivision() {
		return this.sysDivision;
	}

	public void setSysDivision(SysDivision sysDivision) {
		this.sysDivision = sysDivision;
	}

	@Column(name = "name", length = 45)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "code", length = 45)
	public String getCode() {
		return this.code;
	}

	public void setCode(String code) {
		this.code = code;
	}

}